package my2Cents.tools;

import java.awt.event.MouseEvent;

import my2Cents.Util;
import net.phys2d.raw.Body;

public abstract class AbstractBodyModifier extends AbstractPhysTool {
	private Body mod;
	
	public AbstractBodyModifier() {
		setName("Body Modifier");
		setDescription("Click on an object to modify it.");
		//category = "Modifiers";
	}
	
	protected void modify(Body b) {
		b.doOutlineFx();
	}
	
	public void startTool(MouseEvent arg0) {
		super.startTool(arg0);
		mod = Util.selectBody(arg0.getX(), arg0.getY(), getWorld());
		Util.clearHandle(getWorld());
	}
	
	public void endTool(MouseEvent arg0) {
		if(mod != null) {
			modify(mod);
		}
		super.endTool(arg0);
	}
}
